package com.dingding.service.user.core.order.service;

import java.util.ArrayList;
import java.util.List;

import javax.annotation.Resource;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;

import com.dingding.common.core.util.paravalidate.ValidateUtil;
import com.dingding.facade.user.dto.order.ReqGetAllCityWideUserDTO;
import com.dingding.facade.user.dto.order.ResGetAllCityWideUserDTO;
import com.dingding.service.user.core.order.dao.IOrderUserDao;

/**
 * 
 * @ClassName: IOrderUserService 
 * @Description: 订单业务所需用户信息处理
 * @author CHEHAUNBO 
 * @date 2016年8月5日 下午4:37:16
 * 
 */
@Component("orderUserService")
public class OrderUserServiceImpl implements IOrderUserService {

	private static Logger log = Logger.getLogger(OrderUserServiceImpl.class);

	@Resource(name = "orderUserDao")
	private IOrderUserDao orderUserDao;

	/**
	 * 
	 * 获取所有的同城用户,顺路推送时使用
	 * 
	 * @Title: getAllCityWideUserByCity 
	 * @author CHEHAUNBO
	 * @since V2.4.0
	 * 
	 */
	@Override
	public List<ResGetAllCityWideUserDTO> getAllCityWideUserByCity(ReqGetAllCityWideUserDTO reqGetAllCityWideUserDTO) {

		if (!ValidateUtil.validateBean(reqGetAllCityWideUserDTO, ReqGetAllCityWideUserDTO.class)) {
			log.error("获取所有的同城用户出现错误，原因是客户端请求参数为空;" + reqGetAllCityWideUserDTO.toString());
			return new ArrayList<ResGetAllCityWideUserDTO>();
		}
		return orderUserDao.getAllCityWideUserByCity(reqGetAllCityWideUserDTO);
	}

}
